/**
 * Response.java
 */
package fss.common.communication;

import fss.util.rmi.RmiId;

/**
 * A response is the reply of a <code>Request</code>. It wraps
 * the original request.
 * 
 * @author thinh
 * @see fss.common.communication.Message
 * @see fss.common.communication.Request
 */
public abstract class Response extends Message {
    private static final long serialVersionUID = 1L;
    /**
     * The original request.
     */
    protected Request request = null;
    /**
     * Create a response to a request.
     * @param request the original request.
     */
    public Response(Request request) {
        super();
        this.request = request;
    }
    /**
     * Instantiate a response with source and desintation identifiers.
     * @param sourceId the source id.
     * @param destinationId the destination id.
     */
    public Response(RmiId sourceId, RmiId destinationId) {
        super(sourceId, destinationId);
    }
    /**
     * Instantiate a response for a particular destination.
     * @param sourceId the destination id.
     */
    protected Response(RmiId sourceId) {
        super(sourceId);
    }
    /**
     * Get the origination request.
     * @return the request.
     */
    public Request getRequest() {
        return request;
    }
}
